import { axios } from '~/plugins/axios';

// 获取操作权限树
export const getOperationTree = (params?: any) => axios({
  method: 'get',
  url: '/PermissionController/getOperationTree',
  params,
}) as Promise<any>;

// 获取数据权限树
export const getDataTree = (params?: any) => axios({
  method: 'get',
  url: '/PermissionController/getDataTree',
  params,
}) as Promise<any>;

// 查询角色详情
export const getRolesDetail = (params?: any) => axios({
  method: 'get',
  url: '/PermissionController/getRoleDetail',
  params,
}) as Promise<any>;

// 新增和修改角色
export const submitRole = (params: any) => axios({
  method: 'post',
  url: '/PermissionController/editRole',
  data: {
    ...params,
  },
}) as Promise<any>;
